import { IsNotEmpty, IsString } from 'class-validator'
import { ApiProperty } from '@nestjs/swagger'

export class CreateValidatorDto {
  @IsString({
    message: '$property应该为字符串'
  })
  @IsNotEmpty({
    message: '$property不能为空'
  })
  name: string

  @IsNotEmpty({
    message: '$property不能为空'
  })
  @ApiProperty({ description: '年龄', example: 20 })
  age: number
}
